local stock = redis.call('GET', KEYS[1])
if stock == nil or tonumber(stock) < tonumber(ARGV[1]) then
    return -1
else
    return redis.call('DECRBY', KEYS[1], ARGV[1])
end